/**
 *  Copyright 2009-2010 Steven Ottenhoff (Dual-IT)
 * 
 *  This file is part of Clazzified.
 *
 *  Clazzified is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Clazzified is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Clazzified.  If not, see http://www.gnu.org/licenses/gpl.
 * 
 */
package nl.dualit.clazzified.store;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * Represents a clazz model which is implemented as a tree. The tree consists
 * of one root node and zero or more childs. Each child can have zero or more 
 * children.
 * 
 * @author Steven Ottenhoff
 *
 */
public class ClazzModelData {

	private List<Node> nodes;
	
	public ClazzData getRootNode(){
		return null;
	}
}

/**
 * A Node is a ClazzData class wrapped in a tree node element.
 * 
 * @author Steven Ottenhoff
 *
 */
class Node {
	
	private ClazzData root;
	private List<ClazzData> children;
	
	void setRoot( ClazzData root ){
		this.root = root;
	}
	
	ClazzData getRoot(){
		return root;
	}
	
	void addChild( ClazzData child ){
		
		getChildren().add( child );
		
	}
	
	void removeChild( ClazzData child ){
		
		if( getChildren().contains( child ) )
			children.remove( child );
		
	}
	
	List<ClazzData> getChildren(){
		if( children == null )
			children = new ArrayList();
		
		return children;
	}
}